<!doctype html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>

<!--<button onclick="sayHi()">测试</button>-->
<div id="app">
    <button v-on:click="sayHi">测试</button>
</div>

<script src="utils.js"></script>
<script type="text/javascript">
   /* function sayHi() {
        Utils.setUsername("老王")
        alert(Utils.getUsername())
    }*/

  var vm =new Vue({
      el: "#app",
      methods: {
          sayHi: function () {
              Utils.setUsername("张三")
              alert(Utils.getUsername())
          }

      }
  });
</script>

</body>
</html>